package com.itheima.d9Lambda;

import java.util.Arrays;
import java.util.Comparator;

public class LambdaDemo4 {
    public static void main(String[] args) {
        Integer[] numbers = {1,4,5,7,3,10,8,6};
        Arrays.sort(numbers, (Integer o1, Integer o2) -> {
            if(o1 > o2) {
                return 1;
            } else if (o1<o2) {
                return  -1;
            }else{
                return 0;
            }
        });
        System.out.println(Arrays.toString(numbers));
    }

}
